/**
 * Created with IntelliJ IDEA.
 * Description:
 * https://gitee.com/li--jiaqiang/java-test.git
 * git pull
 * git pull origin master
 * git pull origin master --allow-unrelated-histories
 * User: 86187
 * Date: 2022-05-03
 * Time: 10:47
 */

//Scanner scan = new Scanner(System.in);

import java.util.Scanner;

public class TestDemo6 {

    /**
     * 递归求N的阶层
     * @param n
     * @return
     */
    public static int sum(int n) {
        if(n == 1) {
            return n;
        }
        return n * sum(n-1);
    }

    public static void main(String[] args) {

        System.out.println(sum(5));
    }
}
